/*figure 1*/
use figure1, clear
twoway (scatter  rank1 services_gdp) (bar Value rank1, horizontal  xaxis(2)), xlabel(0(5)60,   grid)  ylabel(#30,  angle(horizontal)  labsize(vsmall) valuelabel )graphregion(fcolor(white)) 

/*figure 2: US Trade Balance*/
use figure2, replace
twoway (line goods_exp year, lcolor(black) lwidth(vthin) lpattern(dash)) ///
(line goods_imp year,  lcolor(red) lwidth(vthin) lpattern(dash) ytitle("Billions USD")) ///
(line services_exp year, lcolor(black) ysca(axis(1) r(-1500 2500)) ylab(0(750)2500, axis(1)) ) ///
(line services_imp year,   lcolor(red) xlabel(1992(4)2015) xtitle("")) ///
(bar service_b_gdp year, yaxis(2) ysca(axis(2) r(-7 20)) ylab(-6 -4 -2 0 2, axis(2)) ) ///
(bar goods_b_gdp year, yaxis(2)  ) ///
, yline(0, axis(1) lstyle(foreground)) legend(off) graphregion(fcolor(white)) 

/*figure 3*/
use figure3, clear
graph hbar exports imports,   over(rank) graphregion(fcolor(white)) 

/*figure 4*/
use figure4, clear
twoway (scatter  rank share) (bar value rank, fcolor(none) horizontal  xaxis(2)), xlabel(0(2)25,   )  ylabel(#8,  angle(horizontal)  labsize(small) valuelabel nogrid)graphregion(fcolor(white)) 


/*Figure 5.*/
use figure567, clear
twoway( scatter ln_total ln_exports, mlabel(country)) (lfit  ln_total ln_exports)
/*Figure 6. Goods and Services Exports*/
twoway (scatter ln_exports ln_US_goods_exp if ln_US_goods_exp>8&ln_US_goods_exp<13 , mlabel(country)) (lfit ln_exports ln_US_goods_exp if ln_US_goods_exp>8&ln_US_goods_exp<13) /*BEA data on M1, 2, and 4*/
/*Figure 7. MOFA goods and services*/
twoway(scatter ln_total ln_total_goods, mlabel(country) )(lfit ln_total ln_total_goods)


/*Table 4 and Figure 8 Services Restrictions and Services Trade*/
use services_model, clear
reg ln_total ln_gdp  ln_dist comlang_off  stri, ro
/*Figure 8*/
avplot stri, mlabel(country) mlabsize(vsmall) 
reg ln_total ln_gdp  ln_dist comlang_off  Overall, ro
reg ln_total ln_gdp  ln_dist comlang_off  PAYINV_r, ro
reg ln_exports ln_gdp  ln_dist comlang_off  stri, ro
reg ln_exports ln_gdp  ln_dist comlang_off  Overall, ro
reg ln_exports ln_gdp  ln_dist comlang_off  PAYINV_r, ro
